<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>記事TOP</title>
	<link type="text/css" href="/css/admin/default.css" rel="stylesheet" />
	<link type="text/css" href="/css/admin/index.css" rel="stylesheet" />
</head>
<body>
	<div id="actionbar">
		<a href="/admin/">TOPに戻る</a>
	</div>
	<!-- コンテンツ -->
	<div id="content">
		<h3>記事一覧</h3>
		<table id="table-01">
			<tr>
				<th>No.</th>
				<th>記事 Key</th>
				<th>記事名</th>
				<th>キーワードリスト</th>
				<th>公開</th>
				<th>アクション</th>
			</tr>

			<c:forEach var="article" items="${articleModelList}" varStatus="cl" >
			<tr>
				<td>${cl.index + 1}</td>
				<td><a href="/admin/article/articleEdit?article=${article.keyString}">${article.keyString}</a></td>
				<td>${article.name}</td>
				<td>
					<ul>
						<c:forEach var="keyWord" items="${article.keyWordList}" varStatus="kl" >
						<li>${keyWord}</li>
						</c:forEach>
					</ul>
				</td>
				<td>
					<a href="/admin/article/articlePublic?article=${article.keyString}">
						<c:if test="${article.publicFlg}">
							<img id="publicImages" width="15px" src="/images/admin/btn_checkbox_checked.png" />
						</c:if>
						<c:if test="${!article.publicFlg}">
							<img id="publicImages" width="15px" src="/images/admin/btn_checkbox_default_over.png" />
						</c:if>
					</a>
				</td>
				<td>
					<a href="/admin/article/articleDelete?article=${article.keyString} onclick="return confirm('delete OK?')"">削除</a>
				</td>
			</tr>
			</c:forEach>
		</table>
		<br />

		<h3>記事登録</h3>
		<form method="post" action="articleInsert">
		<table id="table-01">
			<tr>
				<th>項目名</th>
				<th>入力項目</th>
				<th>アクション</th>
			</tr>
			<tr>
				<th>記事名</th>
				<td><input type="text" name="articleName" size="50"/></td>
				<td rowspan="4"><input type="submit" name="submit" value="登録"/></td>
			</tr>
			<tr>
				<th>description</th>
				<td><textarea name="description" cols=45 rows=3 ></textarea></td>
			</tr>
			<tr>
				<th>キーワード</th>
				<td><input type="text" name="keyWord" size="50" value="${keyWord}" /></td>
			</tr>
			<tr>
				<th>記事説明</th>
				<td><textarea name="content" cols=45 rows=30 ></textarea></td>
			</tr>
		</table>
		</form>
	</div>
	<br />
	<br />
</body>
</html>